<?php
/**
 * Flea Site
 *
 * @copyright  Copyright (c) 2008 Movoin Studio (http://movoin.com)
 * @license    Apache License 2.0
 * @version    $Id: Fck.php 130 2009-05-21 14:23:24Z movoin $
 */

/**
 * FckEditor控件
 *
 */
function _ctlFck($name, $args=null)
{
    $opts = array('value', 'style', 'height');
    $data = FLEA_WebControls::extractAttribs($args, $opts);
    FLEA_WebControls::mergeAttribs($args);

    if(!$data['style']) { $data['style']='Default'; }
    if(!$data['height']) { $data['height']=400; }

    $sBasePath = 'site/editor/fckeditor/';
    include_once(FLEA::getAppInf('fckDir').DS.'fckeditor.php');
    $oFCKeditor = new FCKeditor($name);
    $oFCKeditor->BasePath   = $sBasePath;
    $oFCKeditor->Value      = $data['value'];
    $oFCKeditor->ToolbarSet = $data['style'];
    $oFCKeditor->Height     = $data['height'];
    $editor = $oFCKeditor->CreateHtml();
    return $editor;
}
